import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from '../views/LoginView.vue'
import NotFoundView from '@/views/NotFoundView.vue'
import menuArr from './menu'
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
     {
      path: '/login',
      name: 'login',
      component: LoginView,
      meta: {
        title: '登录页',
        requirelogin: true,
      },
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'NotFound',
      component: NotFoundView,
    },
    {
      path: '/',
      name: 'home',
      component: HomeView,
      redirect: "shouye",
      // meta: {
      // requireLogin: true,// 标记当前页面是否需要登录权限
      // },
      children: [...menuArr],
    },

],
});
// const router = createRouter({
//   history: createWebHashHistory(),
//   routes: routes,
// });
export default router;
